package messages;

public class LoginMessage extends Message 
{	
	private String username;
	private String password; 
	private String version;


public LoginMessage(){
	super("Login");
	this.username = "";
	this.password = "";
	this.version = "";
}

public LoginMessage(String username, String password, String version) {
	super("Login");
	this.username = username;
	this.password = password;
	this.version  = version;
}

public String getUsername(){
	return this.username;
}

public void setUsername(String username){
	this.username = username;
}

public String getPassword(){
	return this.password;
}

public void setPassword(String password){
	this.password = password;
}

public String getVersion()
{
	return version;
}

public void setVersion(String version)
{
	this.version = version;
}

// return an XML-formatted version of the message
public String toXML()
{
	String message = "<message>";
    message += "<type>Login</type>";
    message += "<username>" + username + "</username>";
    message += "<password>" + password + "</password>";
    message += "<version>" + version + "</version>";
    message += "</message>";
    
    return message;
}

}
